<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Qwindows</title>
		<script type="text/javascript" src="../scripts/coos.js"></script>
		<script type="text/javascript" src="../scripts/coos.ext.ajax.js"></script>
		<script type="text/javascript" src="../scripts/coos.ui.windows.js"></script>
	</head>
<body>

</body>
<script  type="text/javascript">
/**
*说明：
*js和images文件夹放在同一目录下，在调用之前要先设置系统图片的路径,如：Qwindows.setPath("/js/Qwindows/");最后一个目录必须加"/"
*在同一目录下面不用设置或设置为空Qwindows.setPath("");
*1.桌面div大小为80*60，图片大小为32*27(宽度可变)
*2.action:里面的left,top,width,height为0则表示采用系统默认的数值
*3.所有高宽 位置传入的值都为数字类型的不用加px
*
*4.提供的接口：
*(1)Qwindows.init(w,h,json),其中w,h为主窗口宽高，如果传入0,"",null则默认采用获得页面屏幕宽高
*json格式为：[{'type':'','target':'','title':'','logo':'','left':'','top':'','action':[{'type':'','target':'','title':'','logo':'','url':'','left':'','top':'','width':'','height':''}]}]
*(2)Qwindows.paintDesks(json),其中target作为此桌面的标示(通过Qwindows.desks.get("desk_" + target)可以获得对象),action为双击时创建窗口的json数据
*(3)通过Qwindows.getDesk("desk_" + target)获得desk对象后,desk.setTitle(title)可以改变标题，desk.setLogo(url)可以改变图片，desk.close()可以删除对象
*
*(4)Qwindows.createWindow(json)为创建窗口的入口json包含(type,target,title,logo,url,left,top,width,height)属性，其中left,top,width,height为0则表示采用系统默认的数值
*(5)通过Qwindows.getWindow("win_" + target)获得win对象后的主要方法有：win.setTitle(title)可以改变标题，win.setLogo(url)可以改变标题图片，win.close()可以关闭窗口同时删除此对象
*win.isLoad()判断iframe是否加载完毕,返回true||false,win.setSrc(url)可以改变窗口iframe的url
*
*5.iframe里面的页面调用父窗口的方法为 parent.xxx()
*/

var data = [{'type':'normal','target':'desk1','title':'桌面测试一','logo':'images/Qwindows/dept.png','left':'10','top':'10','action':[{'type':'normal','target':'win1','title':'窗口测试一','logo':'images/Qwindows/group.gif','url':'http://www.baidu.com/','left':'100','top':'30','width':'630','height':'450'}]},{'type':'normal','target':'desk2','title':'桌面测试二','logo':'images/Qwindows/mydept.png','left':'10','top':'80','action':[{'type':'normal','target':'win2','title':'窗口测试二','logo':'images/Qwindows/online.gif','url':'http://www.yodao.com/','left':'0','top':'0','width':'0','height':'0'}]},{'type':'quick','target':'quickopen','title':'快捷方式1','logo':'','left':'0','top':'10','action':[{'type':'quick','target':'','title':'快捷窗口','logo':'','url':'wiki.html','left':'0','top':'0','width':'0','height':'0'}]},{'type':'quick','target':'quick2','title':'快捷方式2','logo':'','left':'0','top':'70','action':[{'type':'quickalpha','target':'','title':'透明快捷窗口','logo':'','url':'TreeData.jsp','left':'0','top':'0','width':'0','height':'0'}]}];

//images包和js在同级目录下不用设置路径
//Qwindows.setPath("./images/");必须在init之前设置系统图片路径--相对页面的路径。
//images/为默认路径,系统默认按照js引用路径，页面和images包在同一路径采用./images/

Qwindows.init(0,0,data);

//Qwindows.setBackgroundColor("#cccccc");
//Qwindows.setBackgroundImage("http://wallcoo.download.it168.com/nature/JAPANESE_LANDSCAPES_1280x1024/mxxx01/%5Bwallcoo.com%5D_JAPANESE_LANDSCAPES_0_0JLA20035E.jpg");



function setTitle(title)
{
	try
	{
		var desk = Qwindows.getDesk ("desk_desk1");
		desk.setTitle(title);
	}
	catch(e)
	{
		setTimeout("setTitle('title_" + Math.random() +"')",500);
	}
}

//setTimeout("setTitle('title_" + Math.random() + "')",500);

function setWinLogo()
{
	if(Qwindows.getWindow ("win_win1"))
	{
		var win = Qwindows.getWindow ("win_win1");
		win.setLogo("images/offline.gif");
		win.setTitle("改变窗口图标和标题了！改变窗口图标和标题了！改变窗口图标和标题了！");
	}
	else
	{
		setTimeout(setWinLogo,200);
	}
}

//setWinLogo();
//Qwindows.createWindow("alpha","alphaId","透明窗口","images/online.gif","TreeData.jsp",0,0,0,0);
//Qwindows.createWindow("maxWin","maxWinId","最大化窗口","images/online.gif","TreeData2.jsp",0,0,0,0);
//Qwindows.openWindow("iiiiii","http://www.baidu.com");
var url = "http://www.yodao.com/search?q=" + parseInt(Math.random()*100);
var win = Qwindows.createWindow("","winId","唯一窗口,通过url改变内容","",url,0,0,0,0);
//Qwindows.openWindow("Qwindows_1","Qwindows_1.html");
//win.setSrc(url);
</script>
</html>
